﻿using System;
using System.Linq;
using System.Collections.Generic;
using NTTDATA.BEENChina.ResultCertification.Config;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Select
{
    [Serializable]
    [VerfityAttribute(Id = "VerfityS0302", Name = "各工程多漏录检证", CategoryType = EnumCategoryType.选择, Model = true)]
    public class VerfityS0302 : VerfityMulitResult
    {
        public override bool CheckResult(List<List<string>> result1, string entryCommon1, List<List<string>> result2, string entryCommon2)
        {
            var resultA = result1.Select(t => t.Select(GetSpecialResult).ToList()).ToList () ;
            var resultB = result2.Select(t => t.Select(GetSpecialResult).ToList()).ToList();
            //return true;
            return new Verfity0302().CheckResult(resultA, entryCommon1, resultB, entryCommon2);
        }




        private  string GetSpecialResult(string colResult)
        {
            var splitResult = new Split.SplitEntryResult(ChildImageObject.CategorySetting.DataFormat, colResult);
            if (ChildImageObject.CategorySetting.DataFormat.Contains("sel"))
            {
                return splitResult.GetSelect();
            }


            return colResult;
        } 
    }
}